package com.chuangshixinchen.enterprise.common;

import java.util.Random;

public class RandomUtil {
    private RandomUtil() {
    }


    // 获取6位随机验证码
    public static String getRandom(int nums) {
        String num = "";
        for (int i = 0 ; i < nums ; i ++) {
            num = num + String.valueOf((int) Math.floor(Math.random() * 9 + 1));
        }
        return num;
    }

    public static int getRangeRandom(int min,int max) {
        Random rand = new Random();
        return rand.nextInt(max - min + 1) + min;
    }
}
